package com.github.zxhTom.demo.jol;

import org.openjdk.jol.info.ClassLayout;

/**
 * @author 张新华
 * @version V1.0
 * @Package com.github.zxhTom.demo.jol
 * @date 2021/12/7 10:35
 */
public class MemoryStatus {
    public static void main(String[] args) {
        User user = new User(19,3.5);
        System.out.println(ClassLayout.parseInstance(user).toPrintable() );
        System.out.println(Integer.toHexString(user.hashCode()));
        System.out.println("hash after");
        System.out.println(ClassLayout.parseInstance(user).toPrintable() );
        synchronized (user) {
            System.out.println(ClassLayout.parseInstance(user).toPrintable() );
        }
    }
}
